﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MX.Core.Http.MVC.Model
{
    /// <summary>
    /// API返回值基类
    /// </summary>
    public abstract class ApiReturnBase
    {
        /// <summary>
        /// 错误代码，0表示无错误
        /// </summary>
        [JsonProperty(PropertyName = "errorCode")]
        public int ErrorCode { get; set; }
        /// <summary>
        /// 错误消息
        /// </summary>
        [JsonProperty(PropertyName = "errorMsg")]
        public string ErrorMsg { get; set; }


        public bool IsOk()
        {
            return ErrorCode == 0;
        }
    }
}
